Skip to content

W-21432256: Salesforce Payments on PWA Feature#3722

Closed
rasbhat wants to merge 96 commits intodevelopfrom
test-t/team404/sfp-on-pwa-kit
Closed

W-21432256: Salesforce Payments on PWA Feature#3722
rasbhat wants to merge 96 commits intodevelopfrom
test-t/team404/sfp-on-pwa-kit

Conversation

@rasbhat
Copy link

@rasbhat rasbhat commented Mar 5, 2026

This PR is in continuation of #3709, has been raised to resolve cla:missing label.

This PR spans 3 packages with ~15,165 lines added across 120 files (including tests and translations). The changes enable Stripe, Adyen, and PayPal payment processing via the SF Payments SDK, with both standard checkout and express payment flows (Apple Pay, Google Pay, PayPal, Venmo).

Gus item: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002VgsrOYAR/view

Description

This document summarizes the Salesforce Payments on PWA Feature:
https://salesforce.quip.com/UErWA4QiaiES

Areas that are common and can be reviewed further include

  • changes to package,json
  • changes to default.js files (template and handle-bars)
  • changes to ssr.js
  • commerce sdk react
  • Any v1-V2 changes that might be applicable outside of Payments
  • Shared Components/files:
    • ProductView
    • Routes.jsx
    • Constants.js
    • Cartmodal
    • Addressfield
    • Usecurrentbasket hook
    • Usecurrentcustomer hook
    • Checkout index
    • CheckoutContext

Areas that are Domain/Payments specific

  • There are many components,hooks,changes to pages done as part of Salesforce Payments. Hopefully the attached doc will help but its pretty involved to understand the business logic

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • (step1)

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

alafemina and others added 30 commits October 20, 2025 10:08
* PWA on SFP spike

* sfp on pwa part 1

* use new payment instrument request

* conditionally render express box

* add ShopperPayments tests

* lint and tests

* address comments

* clean up

---------

Co-authored-by: Jeff Raab <jraab@salesforce.com>
* render paypal

* refactor shopper config checker
* refactor shopper config checker

* baskets v2 temp commit

* complete paypal and code clean up

* address comments

* fix
* @W-19685609 Express on PDP with Temporary Basket

* Address Code Review: Fix comments, remove eagerly created validations, move temp basket to its a hook, i10n for errors, etc

* Address Code Review: Fix additional comments, i10 labels, set keepPreviousData to false by default in current basket hook

* Address Code Review: do not set keepPreviousData flag to true in useCurrentBasket hook until further testing confirms that it is needed

* Address updates to SDK event changes in payment sheet

* Remove the optional keepPreviousData property setting in usecurrentbasket hook

* Undo i10 call for an error that nees to be looged into console only

* Reset maximumButtonCount to 1

* Remove commented line

* Replace undefined with empty function for onclick action in payment sheet
…/sfp-update-amount-prevent-reinit

@W-20117176 : Call updateAmount on Order Total change
* W-19443266:  Handle Failure use-cases by calling Fail Order where necessary.  Also refactor the client-secret retrieval since the response structure has changed.
…/order-confirmation-hide-sfp-payment-details

@W-19799923: Remove payment details on order confirmation page for SFP orders
rasbhat and others added 13 commits March 3, 2026 12:34
…/fail-order-on-redirect

W-21372336: Fail Order for redirect based payments
…/stripe-caching-for-display-spm-fix-tests

W-21411273, W-21434212: Fix for Display SPMs at checkout due to caching issues and Fix for failing tests on feature branch
…/merge-changes-from-develop

W-21436534: Merge from Develop to feature branch
* W-21432256: address code review comments from PWA team
…/payment-sheet-zone-id

W-21324157: Zone ID updated to use paymentconfig zoneID in Payment Sheet
…-20911530-UT

W-20911530: fixing failing unit test
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Mar 5, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@rasbhat rasbhat changed the title TEST PR, DO NOT MERGE W-21432256: Salesforce Payments on PWA Feature Mar 5, 2026
@rasbhat rasbhat marked this pull request as ready for review March 5, 2026 04:35
@rasbhat rasbhat requested review from a team as code owners March 5, 2026 04:35
@syadupathi-sf
Copy link
Collaborator

Changes in the One click checkout files look good to me.Approved.

// Set enabled to true to enable Salesforce Payments (requires the Salesforce Payments feature toggle to be enabled on the Commerce Cloud instance).
// Set enabled to false to disable Salesforce Payments on the storefront (the Commerce Cloud feature toggle is unaffected).
// sdkUrl and metadataUrl are hosted on your Commerce Cloud instance. Replace <hostname> with your instance hostname.
// This may be a demandware.net hostname (e.g., myinstance.unified.demandware.net) or a vanity/custom hostname.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a demandware.net hostname is allowed due to origin blocking. I think this has to be a vanity domain.

Also, could a proxy to commerce cloud work? Ie. https://<PWA Kit hostname>/mobify/proxy/ocapi/on/demandware.static/Sites-Site/-/-/internal/jscript/sfp/v1/sfp where /mobify/proxy/ocapi is set up to route requests to ecom?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't know how the vanity urls work and how the production urls even look like. Our internal ODS systems tend to have demandware.net. So I said 'maybe' but if we have a definitive pattern on how these urls look like in production, we can change that comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For active data in PWA Kit v3 (and for OCAPI requests on PWA Kit v2), we used to set up a 2nd proxy /mobify/proxy/ocapi that points to the ecom instance under *.commercecloud.salesforce.com.

Screenshot 2026-03-05 at 10 22 19 AM

Here's what a response for Active Data looks like on the PWA Kit demo env using the proxy
Screenshot 2026-03-05 at 10 24 42 AM

@@ -1,4 +1,5 @@
## v9.1.0-dev
- [Feature] Add Salesforce Payments support in checkout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's update the changelog entry with a link to this PR

protocol: process.env.DEV_SERVER_PROTOCOL || 'http',

// SSL file path for HTTPS development
sslFilePath: process.env.DEV_SERVER_SSL_FILE_PATH,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these need to be added to the ssr.js templates in the pwa-kit-create-app generator>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only added it to the local development template and not to the handlebar files. local host requires ssl and https for payments, else development and debugging is not possible. But something to discuss

@@ -1,4 +1,5 @@
## v5.1.0-dev
- Bump commerce-sdk-isomorphic to 5.1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's add he link for this PR to this changelog entry

@@ -0,0 +1,470 @@
/*
* Copyright (c) 2025, salesforce.com, inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's update these to 2026

import {useToast} from '@salesforce/retail-react-app/app/hooks/use-toast'
import {PAYMENT_GATEWAYS} from '@salesforce/retail-react-app/app/constants'

// const ADYEN_SUCCESS_RESULT_CODES = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can clean this up I think

import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket'
import {AuthHelpers, useAuthHelper, useShopperBasketsMutation} from '@salesforce/commerce-sdk-react'
import {isAbsoluteURL} from '@salesforce/retail-react-app/app/page-designer/utils'
import {useAppOrigin} from '@salesforce/retail-react-app/app/hooks/use-app-origin'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these imports for isAbsoluteURL and useAppOrigin needed?

Comment on lines +381 to +382
'google.com',
'www.google.com'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the merge, as discussed in this comment from the previous PR, please update it to be more narrow scoped. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we will need to verify it and run some E2E to make sure we capture the exact domains since we don't want to be in a situation where the feature breaks either because of CSP

Copy link
Contributor

@vcua-mobify vcua-mobify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following a sync meet, the remaining comments will be addressed in a quick follow PR

Copy link
Contributor

@sf-henry-semaganda sf-henry-semaganda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rasbhat
Copy link
Author

rasbhat commented Mar 5, 2026

This PR has been squash merged to develop in this PR here: #3725. Closing this PR .

@rasbhat rasbhat closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.